package com.guigu.zj.controller;

import com.guigu.pojo.Jb;
import com.guigu.pojo.Yyisitroom;
import com.guigu.zj.pojo.PageVo;
import com.guigu.zj.service.JbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class JbController {
    @Autowired
    JbService jbService;
    @RequestMapping("Z_queryJb")
    public PageVo<Jb> queryJb(@RequestBody PageVo<Jb> jb){
        return jbService.queryAll(jb);
    }
    @RequestMapping("Z_findY")
    public List<Yyisitroom> findY(){
        return jbService.find();
    }
    @RequestMapping("Z_addJb")
    public int add(@RequestBody Jb jb){
        return jbService.insertSelective(jb);
    }
    @RequestMapping("/Z_jbById")
    public Jb ById(@RequestBody Jb jb){
        return jbService.selectByPrimaryKey(jb.getId());
    }
    @RequestMapping("Z_jbUp")
    public int jbUp(@RequestBody Jb jb){
        return jbService.updateByPrimaryKeySelective(jb);
    }
    @RequestMapping("/Z_jbDel")
    public int del(Integer id){
        return jbService.deleteByPrimaryKey(id);
    }
}
